<template>
    <div class="wrap">
        home
        <product v-for="(item,i) in products" :item="item" :key="i"></product>
        {{totalCount}}
    </div>
</template>
<script>
import {mapActions,mapState,mapGetters} from 'vuex'
import product from '../components/product'
export default {
    created(){
        this.getData();
    },
    computed:{
        ...mapState(['products']),
        ...mapGetters(['totalCount'])
    },
    methods:{
        ...mapActions(['getData'])
    },
    components:{
        product
    }
}
</script>
